display_plate(plateplan_A %>%
mutate(SampleID=Strain))
display_plate(plateplan_B %>%
mutate(SampleID=Strain))
# read my plates
plates_1 <- read_tsv("data/JA_20200830-shortvslong_n1-ct.txt",skip=1) %>%
mutate(Well=Pos,Cq=Cp,ExpRep = 1,ExpRep=factor(ExpRep)) %>%
left_join(plateplan_A)
plates_2 <- read_tsv("data/JA_20200831-shortvslong_n2-ct.txt",skip=1) %>%
mutate(Well=Pos,Cq=Cp,ExpRep = 2,ExpRep=factor(ExpRep)) %>%
left_join(plateplan_B)
plates <- bind_rows(plates_1, plates_2)
summary(plates)
## Include Color Pos Name
## Mode:logical Min. : 255 Length:768 Length:768
## TRUE:768 1st Qu.: 255 Class :character Class :character
## Median : 255 Mode :character Mode :character
## Mean :13379
## 3rd Qu.: 255
## Max. :65280
##
## Cp Concentration Standard Status Well
## Min. : 8.45 Mode:logical Min. :0 Mode:logical Length:768
## 1st Qu.: 9.64 NA's:768 1st Qu.:0 NA's:768 Class :character
## Median :10.49 Median :0 Mode :character
## Mean :13.52 Mean :0
## 3rd Qu.:12.83 3rd Qu.:0
## Max. :35.94 Max. :0
## NA's :155
## Cq ExpRep WellR WellC Type
## Min. : 8.45 Length:768 Length:768 1 : 30 +RT :540
## 1st Qu.: 9.64 Class :character Class :character 2 : 30 -RT :180
## Median :10.49 Mode :character Mode :character 3 : 30 NA's: 48
## Mean :13.52 4 : 30
## 3rd Qu.:12.83 5 : 30
## Max. :35.94 (Other):570
## NA's :155 NA's : 48
## TechRep SampleID Strain Pro_mCh
## 1 :360 Length:768 Length:768 Length:768
## 2 :180 Class :character Class :character Class :character
## 3 :180 Mode :character Mode :character Mode :character
## NA's: 48
##
##
##
## Promoter mCherry Ter_length Terminator
## Length:768 Length:768 Length:768 Length:768
## Class :character Class :character Class :character Class :character
## Mode :character Mode :character Mode :character Mode :character
##
##
##
##
## Length BioRep TargetID remove
## Length:768 Length:768 mCh-7 :144 Mode :logical
## Class :character Class :character PGK1-ORF:144 FALSE:720
## Mode :character Mode :character RPS3-ORF:144 NA's :48
## SRO9-ORF:144
## URA3-ORF:144
## NA's : 48
##
platecurve_A <- read_tsv("data/JA_20200830-shortvslong_n1.txt",skip=2,
col_names=c("Well","SID","Program","Segment","Cycle","Time","Temperature","Fluor")) %>%
debaseline() %>%left_join(plateplan_A)%>%
mutate(ExpRep = 1,ExpRep=factor(ExpRep))
platecurve_B <- read_tsv("data/JA_20200831-shortvslong_n2.txt",skip=2,
col_names=c("Well","SID","Program","Segment","Cycle","Time","Temperature","Fluor")) %>%
debaseline() %>%left_join(plateplan_B)%>%
mutate(ExpRep = 2,ExpRep=factor(ExpRep))
platecurve <- bind_rows(platecurve_A, platecurve_B)
platesamp <- platecurve %>% filter(Program == 2)
platesmelt <- platecurve %>% filter(Program != 2) %>% getdRdTall() %>% filter(Temperature >= 61)
Normalisation of all Cq values against the median of Cq values of normalising genes (PGK1-ORF and RPS3-ORF). This calculation takes the median of normTargetIDs (getNormCq function default is median)
# platesnorm normalises the Cq values by the median of normTargetIDs
platesnorm <- plates %>%
filter(!Strain %in% c("POT1-ccdB"), Type=="+RT") %>%
normalizeqPCR(normTargetIDs = c("PGK1-ORF", "RPS3-ORF"))
platesnorm_summarise <- platesnorm%>%
group_by(Strain, TargetID, BioRep, ExpRep)%>%
summarize(Median_deltaCq = median(Value.norm, na.rm=TRUE),
RNA_Abundance = (2^-Median_deltaCq), na.rm=FALSE)%>%
ungroup(Strain)%>%
mutate(Strain = factor(Strain,levels = c("pRPS3-mCherry-tRPS3_WT-59bp",
"pRPS3-mCherry-tRPS3_WT-86bp", "pRPS3-mCherry-tRPS3_WT-200bp",
"pSRO9-mCherry-tSRO9_WT-200bp", "pSRO9-mCherry-tSRO9_WT-500bp")),
TargetID = factor (TargetID, levels = c("PGK1-ORF", "SRO9-ORF", "RPS3-ORF",
"URA3-ORF", "mCh-7")))%>%
separate(Strain, remove = FALSE,sep="-",into=c("Promoter","mCherry","Terminator","Length"))%>%
mutate(Ter_length = factor(Length,levels = c("500bp","200bp","86bp","59bp")),remove = FALSE)%>%
unite(Pro_mCh,Promoter,mCherry,sep="-", remove=FALSE)%>%
unite(Ter_length, Terminator, Length, sep="-", remove=FALSE)
#exporting platesnorm_summarise dataframe
write.csv(platesnorm_summarise,"analysed_data/shortvslong/deltaCq_platesnorm_summarise.csv", row.names = FALSE)
ggplot(platesnorm, aes(Ter_length,Value.norm))+
geom_point(aes(color=BioRep),position=position_dodge(width = 0.85),size=1.2, alpha=0.7)+
scale_colour_hue(h = c(90, 360)+20,l=60,c=60)+
labs(y="delta Cq", x="3'UTR-terminators")+
facet_wrap(~TargetID)+
theme(axis.text.x=element_text(angle=90,vjust=0.5))+
geom_hline(yintercept = 0, color = "black", linetype= 'dotted', size=1)
ggplot(platesnorm %>% filter(Promoter %in% c("pRPS3")), aes(Ter_length,Value.norm))+
geom_point(aes(color=BioRep),position=position_dodge(width = 0.8),size=1.5, alpha=0.7)+
scale_colour_hue(h = c(90, 360)+20,l=60,c=60)+
ylim(-6,6)+
labs(y="delta Cq", x="3'UTR-terminators")+
facet_wrap(~TargetID)+
theme(axis.text.x=element_text(angle=90,vjust=0.5))+
geom_hline(yintercept = 0, color = "black", linetype= 'dotted', size=1)
ggplot(platesnorm %>% filter(Promoter %in% c("pSRO9")), aes(Ter_length,Value.norm))+
geom_point(aes(color=BioRep),position=position_dodge(width = 0.8),size=1.5, alpha=0.7)+
scale_colour_hue(h = c(90, 360)+20,l=60,c=60)+
ylim(-6,6)+
labs(y="delta Cq", x="3'UTR-terminators")+
facet_wrap(~TargetID)+
theme(axis.text.x=element_text(angle=90,vjust=0.5))+
geom_hline(yintercept = 0, color = "black", linetype= 'dotted', size=1)
ggplot(platesnorm %>% filter(TargetID %in% 'mCh-7'), aes(Ter_length,Value.norm))+
geom_point(aes(color=ExpRep),position=position_dodge(width = 0.85),size=1.2, alpha=1)+
scale_colour_hue(h = c(90, 360)+20,l=60,c=60)+
labs(y="delta Cq", x="3'UTR-terminators")+
#facet_wrap(~Promoter)+
theme(axis.text.x=element_text(angle=90,vjust=0.5))+
geom_hline(yintercept = 0, color = "black", linetype= 'dotted', size=1)
normalised_Exp_pRPS3 <- ggplot(data = platesnorm_summarise %>% filter(Promoter %in% 'pRPS3'))+
geom_point(aes(RNA_Abundance,TargetID,colour=TargetID, shape=BioRep)) +
scale_x_log2nice(name="2^deltaCq (log2 scale)",omag = seq(-5,5),scilabels=TRUE) +
labs(y="") +
scale_shape_manual(values=c(19, 17, 15, 10, 7, 14)) +
scale_colour_manual(values=c("#416db0", "#6f3ba1", "#a84a9a", "black","#CC6666")) +
guides(colour=FALSE) +
theme(axis.text.y=element_text(colour=c("#416db0", "#6f3ba1", "#a84a9a", "black","#CC6666")),
axis.text.x=element_text(angle=0,vjust=0.5),
axis.title.x=element_text(size=10,vjust=-2),
legend.position="right")+
facet_wrap(~Strain,ncol = 1)
normalised_Exp_pRPS3 + stat_summary(aes(RNA_Abundance,TargetID),
fun="mean",colour="black",
geom="crossbar",size=0.2, width=0.5)
normalised_Exp_pRPS3 <- ggplot(data = platesnorm_summarise %>% filter(Promoter %in% 'pSRO9'))+
geom_point(aes(RNA_Abundance,TargetID,colour=TargetID, shape=BioRep)) +
scale_x_log2nice(name="2^deltaCq (log2 scale)",omag = seq(-5,5),scilabels=TRUE) +
labs(y="") +
scale_shape_manual(values=c(19, 17, 15, 10, 7, 14)) +
scale_colour_manual(values=c("#416db0", "#6f3ba1", "#a84a9a", "black","#CC6666")) +
guides(colour=FALSE) +
theme(axis.text.y=element_text(colour=c("#416db0", "#6f3ba1", "#a84a9a", "black","#CC6666")),
axis.text.x=element_text(angle=0,vjust=0.5),
axis.title.x=element_text(size=10,vjust=-2),
legend.position="right")+
facet_wrap(~Strain,ncol = 1)
normalised_Exp_pRPS3 + stat_summary(aes(RNA_Abundance,TargetID),
fun="mean",colour="black",
geom="crossbar",size=0.2, width=0.5)
# Extracting data for pSRO9 strains
platesnorm_pSRO9_ExpRep <- platesnorm %>% filter(Promoter %in% "pSRO9", TargetID %in% "mCh-7")
# Calculates the mean Cq value of pSRO9-mCherry-tSRO9_WT-500bp Strain (4.111667)
mean_platesnorm_S500bp_ExpRep1 <- platesnorm_pSRO9_ExpRep %>% filter(ExpRep==1)%>%
select(c("Strain","Value.norm", "BioRep", "TechRep")) %>%
filter(Strain %in% c("pSRO9-mCherry-tSRO9_WT-500bp")) %>%
group_by(Strain, BioRep)%>%
summarize(median_BioRep_S500bp = median(Value.norm)) %>%
ungroup()%>%
group_by(Strain)%>%
summarize(mean_S500bp = mean(median_BioRep_S500bp))
# Calculates the mean Cq value of pSRO9-mCherry-tSRO9_WT-500bp Samples (4.035)
mean_platesnorm_S500bp_ExpRep2 <- platesnorm_pSRO9_ExpRep %>%
filter(ExpRep==2)%>%
select(c("Strain","Value.norm", "BioRep", "TechRep")) %>%
filter(Strain %in% c("pSRO9-mCherry-tSRO9_WT-500bp")) %>%
group_by(Strain, BioRep)%>%
summarize(median_BioRep_S500bp = median(Value.norm)) %>%
ungroup()%>%
group_by(Strain)%>%
summarize(mean_S500bp = mean(median_BioRep_S500bp))
# Calculates the delta delta Cq (subtracts mean(mean_tSRO9500bp$Value.norm) from every Value.norm))
platesnorm_by_S500bp_pSRO9_ExpRep1 <- platesnorm_pSRO9_ExpRep %>% filter(ExpRep==1)%>%
mutate(Value.norm.S500bp = Value.norm - mean_platesnorm_S500bp_ExpRep1$mean_S500bp, remove=FALSE)
platesnorm_by_S500bp_pSRO9_ExpRep2 <- platesnorm_pSRO9_ExpRep %>% filter(ExpRep==2)%>%
mutate(Value.norm.S500bp = Value.norm - mean_platesnorm_S500bp_ExpRep2$mean_S500bp, remove=FALSE)
# Extracting data for pRPS3 strains
platesnorm_pRPS3_ExpRep <- platesnorm %>% filter(Promoter %in% "pRPS3", TargetID %in% "mCh-7")
# Calculates the mean Cq value of pRPS3-mCherry-tRPS3_WT-200bp Strain (-1.12)
mean_platesnorm_R200bp_ExpRep1 <- platesnorm_pRPS3_ExpRep %>% filter(ExpRep==1)%>%
select(c("Strain","Value.norm", "BioRep", "TechRep")) %>%
filter(Strain %in% c("pRPS3-mCherry-tRPS3_WT-200bp")) %>%
group_by(Strain, BioRep)%>%
summarize(median_BioRep_R200bp = median(Value.norm)) %>%
ungroup()%>%
group_by(Strain)%>%
summarize(mean_R200bp = mean(median_BioRep_R200bp))
# Calculates the mean Cq value of pRPS3-mCherry-tRPS3_WT-200bp Samples (-0.9216667)
mean_platesnorm_R200bp_ExpRep2 <- platesnorm_pRPS3_ExpRep %>%
filter(ExpRep==2)%>%
select(c("Strain","Value.norm", "BioRep", "TechRep")) %>%
filter(Strain %in% c("pRPS3-mCherry-tRPS3_WT-200bp")) %>%
group_by(Strain, BioRep)%>%
summarize(median_BioRep_R200bp = median(Value.norm)) %>%
ungroup()%>%
group_by(Strain)%>%
summarize(mean_R200bp = mean(median_BioRep_R200bp))
# Calculates the delta delta Cq (subtracts mean(mean_tSRO9500bp$Value.norm) from every Value.norm))
platesnorm_by_R200bp_pRPS3_ExpRep1 <- platesnorm_pRPS3_ExpRep %>% filter(ExpRep==1)%>%
mutate(Value.norm.R200bp = Value.norm - mean_platesnorm_R200bp_ExpRep1$mean_R200bp, remove=FALSE)
platesnorm_by_R200bp_pRPS3_ExpRep2 <- platesnorm_pRPS3_ExpRep %>% filter(ExpRep==2)%>%
mutate(Value.norm.R200bp = Value.norm - mean_platesnorm_R200bp_ExpRep2$mean_R200bp, remove=FALSE)
In the previous 2 chunks, we have calculated the delta-delta Cq value for each techrep. Here, we are summarising that information by calculating the median Cq for each biorep and calculating the RNA abundance (2^-Median_Cq).
platesnorm_S500bp_pSRO9_median <- bind_rows(platesnorm_by_S500bp_pSRO9_ExpRep1,platesnorm_by_S500bp_pSRO9_ExpRep2)%>%
group_by(Strain, TargetID, BioRep, ExpRep)%>%
summarize(Median_delta_deltaCq = median(Value.norm.S500bp, na.rm=TRUE),
RNA_Abundance = (2^-Median_delta_deltaCq), na.rm=FALSE)%>%
separate(Strain, remove = FALSE,sep="-",into=c("Promoter","mCherry","Terminator", "Length")) %>%
unite(Pro_mCh,Promoter,mCherry,sep="-", remove=FALSE)%>%
unite(Ter_length,Terminator,Length,sep="_", remove=FALSE)
platesnorm_R200bp_pRPS3_median <- bind_rows(platesnorm_by_R200bp_pRPS3_ExpRep1,platesnorm_by_R200bp_pRPS3_ExpRep2)%>%
group_by(Strain, TargetID, BioRep, ExpRep)%>%
summarize(Median_delta_deltaCq = median(Value.norm.R200bp, na.rm=TRUE),
RNA_Abundance = (2^-Median_delta_deltaCq), na.rm=FALSE)%>%
ungroup(Strain)%>%
mutate(Strain = factor(Strain,levels = c("pRPS3-mCherry-tRPS3_WT-86bp", "pRPS3-mCherry-tRPS3_WT-59bp",
"pRPS3-mCherry-tRPS3_WT-200bp")))%>%
separate(Strain, remove = FALSE,sep="-",into=c("Promoter","mCherry","Terminator", "Length")) %>%
unite(Pro_mCh,Promoter,mCherry,sep="-", remove=FALSE)%>%
unite(Ter_length,Terminator,Length,sep="_", remove=FALSE)
platesnorm_all_median <- bind_rows(platesnorm_S500bp_pSRO9_median,platesnorm_R200bp_pRPS3_median)